package com.lntea.security.base64;

import org.apache.commons.codec.binary.Base64;
import org.bouncycastle.util.encoders.UrlBase64;

public class LnteaUrlBase64 {
	private static String encoding = "lntea url base64";
	
	public static void main(String[] args) {
		bcUrlBase64();
		
		ccUrlBase64();
	}
	
	public static void bcUrlBase64(){
		byte[] encodingBytes = UrlBase64.encode(encoding.getBytes());
		System.out.println("urlbase64 encode:"+new String(encodingBytes));
		
		byte[] decodeingBytes = UrlBase64.decode(encodingBytes);
		System.out.println("urlbase64 decode:"+new String(decodeingBytes));
	}
	
	public static void ccUrlBase64(){
		byte[] encodingBytes = Base64.encodeBase64URLSafe(encoding.getBytes());
		System.out.println("urlbase64 encode:"+new String(encodingBytes));
		
		byte[] decodingBytes = Base64.decodeBase64(encodingBytes);
		System.out.println("urlbase64 decode:"+new String(decodingBytes));
	}
}
